<template>
  <h1>父组件</h1>
  <h1>{{ age }}</h1>
  <hr />
  <!-- //!记住：这里的 $event 可不是事件对象，永远永远是 emit 的第二个参数 -->
  <!-- <Son :modelValue="msg" @update="msg = $event" /> -->
  <!-- <Son :modelValue="msg" @update:modelValue="msg = $event" /> -->
  <!-- 和上面等价 -->
  <Son v-model="msg" v-model:age="age" />
  <!-- v-model = :modelValue + @update:modelValue="msg = $event" -->
</template>
<script>
import { ref } from 'vue'
import Son from './Son.vue'
export default {
  name: 'App',
  components: {
    Son,
  },
  setup() {
    const msg = ref(8)
    const age = ref(18)
    return {
      msg,
      age,
    }
  },
}
</script>
